import request from '@/config/axios'

// appbaner VO
export interface BannerVO {
  id: number // 编号
  url: string // 文件地址
  name: string // 名字
  sort: number // 排序
  status: string // 状态
  remark: string // 描述
}

// appbaner API
export const BannerApi = {
  // 查询appbaner分页
  getBannerPage: async (params: any) => {
    return await request.get({ url: `/psy/banner/page`, params })
  },

  // 查询appbaner详情
  getBanner: async (id: number) => {
    return await request.get({ url: `/psy/banner/get?id=` + id })
  },

  // 新增appbaner
  createBanner: async (data: BannerVO) => {
    return await request.post({ url: `/psy/banner/create`, data })
  },

  // 修改appbaner
  updateBanner: async (data: BannerVO) => {
    return await request.put({ url: `/psy/banner/update`, data })
  },

  // 删除appbaner
  deleteBanner: async (id: number) => {
    return await request.delete({ url: `/psy/banner/delete?id=` + id })
  },

  // 导出appbaner Excel
  exportBanner: async (params) => {
    return await request.download({ url: `/psy/banner/export-excel`, params })
  },
}